FNP - Protocol - Insert Operation Complete Flow
Summary (Explain Like I’m 5)
When you type a character in a collaborative encrypted document, here’s what happens invisibly behind the scenes:- Your computer generates a secret position for the character using LSEQ
- Your computer encrypts the character with Kyber
- Your computer creates a mathematical proof proving “this is legit”
- Your computer sends all encrypted data to the server
- Server verifies the proof (can’t read your character!)
- Server places character in correct position using M²-ORE comparison
- Other computers receive the encrypted character and decrypt if they can
Technical Deep Dive
Insert Operation Protocol Flow (Complete):Mermaid Diagrams
Key Terms
- Blind Verification → Server verifies Halo2 proof without accessing secret keys
- Lamport Clock → Monotonic counter ensuring causal ordering of operations
- Deterministic Merge → M²-ORE comparison gives consistent ordering on server
- Replicated State → Each client and server maintain copy of encrypted document
- CRDT Semantics → Commutative, associative merge enables offline edits
- Proof of Correctness → Halo2 ensures position and authorization are valid
- Content Confidentiality → Only authorized users can decrypt with Kyber_sk
- Non-repudiation → Dilithium signature proves operation originates from specific replica
Q/A
Q: Why does server need blind proof verification if it’s trusted? A: Server is trusted to coordinate but not trusted with plaintext. Blind proof verification ensures server can’t be compromised to read document content. Proofs verify correctness without needing access to secrets. Q: What if two clients insert at same position simultaneously? A: Both generate unique LSEQ identifiers (with different replica IDs and Lamport clocks). Server receives both operations. M²-ORE.compare() deterministically orders them. Both inserts are merged, neither lost. Q: Can the server reorder operations? A: No. Lamport clocks and timestamps provide causal ordering. If server reorders op1 and op2 where op1 happened first (lower Lamport clock), clients detect the inconsistency. Reordering would require forging new Halo2 proofs (cryptographically hard). Q: What’s the latency end-to-end? A: Typical: ~50ms. Breakdown: (1) Local proof generation: 1-2ms, (2) Network round-trip: 20-30ms, (3) Server verification: 5ms, (4) Broadcast to others: 10-20ms. Mobile WASM: slower but still <500ms acceptable. Q: Can I decrypt other users’ content? A: No. Each user’s content is encrypted with their Kyber public key. Other users see the Kyber ciphertext but can’t decrypt without your Kyber secret key. Server never has your secret key. Q: What happens if Halo2 proof verification fails? A: Server rejects the operation immediately. Operation is not merged, not broadcast, not visible to any client. Client receives rejection message; typically due to: invalid operation, corrupted proof, or replay attack.Example / Analogy
Bank Check Analogy: When you insert character (type “H”), it’s like writing a bank check:-
You write the check:
- Amount (position): Sealed in M²-ORE envelope
- Payee (content): Sealed in Kyber envelope
- Signature (Dilithium): Your autograph
- Proof of funds (Halo2): Bank’s auditor verifies without seeing amount
-
Bank processes check:
- Verifies your signature (Dilithium)
- Verifies auditor’s proof (Halo2 - bank can’t read amount!)
- Determines position by comparing sealed envelopes (M²-ORE)
- Merges with other checks
-
Other customers see the check:
- See that check exists (encrypted)
- See it’s from you (signature)
- If they have your envelope key: can read the amount
- If not: see only encrypted data (privacy preserved!)
Cross-References: System Overview, M²-ORE Encryption, LSEQ CRDT, Kyber-1024, Halo2 Circuits Category: Protocol | Data Flow | Operations | Implementation Difficulty: Advanced ⭐⭐⭐⭐ Updated: 2025-11-28